import {  Ref } from 'vue'
import { createListOperationColumn } from '@longnows/ui'
const useListOperation = (commonListRef: Ref<Recordable | null>) => {
  const refreshList = () => {
    commonListRef.value?.refresh()
  }

  const map = new Map([
    [
      'operationTest',
      ({ }) => ({
        click: () => {
          refreshList()
        }
       }),
    ]
  ])
  const addOperationColumn = (actions) => {
    return createListOperationColumn(actions, map)
  }
  return {
    addOperationColumn,
  }
}

export default useListOperation
